Usage ( ) Function Types
You can use the usage( ) function in conjunction with the date() function and a method to find usage metrics for a given date or date range. The following table lists methods for using the usage( ) function and date( ) function together. For more information on string syntax, see the table in Date( ) Function.
Method | Example | Return Type | Return Value |
---|---|---|---|
count | usage(date('last 30 days')).count | Integer | The number of rule usages for the specified date range. The date() function is optional. If you don't provide a date range, then the query searches all rules in the database, regardless of their creation date. |
percent | usage(date('last 30 days')).percent | Percentage | The number of rules in the date range in relation to the number of total rules in a policy, expressed as a percentage. |
obj.count | usage(date('last 30 days')).obj.count | String | The number of uses of a specified object for the specified date range. |